/*package org.jin.samples.dao.impl;


import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.jin.samples.model.UserJDBC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class UserHiberanteDAO {
	
	@Autowired
	private SessionFactory sessionFactory;
	
	public Session getSession(){
		return this.sessionFactory.getCurrentSession();
	}
	
	public List<UserJDBC> findAllUsers(){
		Session session = getSession();
		String hql = "FROM UserJDBC";
		@SuppressWarnings("unchecked")
		List<UserJDBC> userList = session.createQuery(hql).list();
		return userList;
	}
	
	public UserJDBC getUserById(String id){
		Session sessoion = getSession();
		return (UserJDBC) sessoion.get(UserJDBC.class, id);
	}
	
	public void editUser(UserJDBC user)throws Exception{
		Session session = getSession();
		session.update(user);
	}
	
	public void createUser(UserJDBC user)throws Exception{
		Session session = getSession();
		session.save(user);
	}
	
	public void deleteUser(String id)throws Exception{
		Session session = getSession();
		UserJDBC exsitsUser = (UserJDBC) session.get(UserJDBC.class, id);
		if(exsitsUser != null){
			session.delete(exsitsUser);
		}
	}
	
}


*/